<?php

namespace App;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class App extends Model
{
    protected $fillable = [
        'title','logo','version','size','supportsystem','url','downurl','content','time','appcatid'
    ];

    public function getTimeAttribute()
    {
        return Carbon::parse($this->attributes['time'])->format('Y-m-d');
    }

    public function appcat()
    {
        return $this->belongsTo('App\Appcat','appcatid','id');
    }
}
